package com.jinhua.medical.manager.controller;

import com.jinhua.medical.manager.common.GlobleConstant;
import com.jinhua.medical.manager.common.JSONResult;
import com.jinhua.medical.manager.service.BackUserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 用户控制器
 * Created by 王兴光 on 2018/7/5.
 */
@Controller
@RequestMapping("/user")
public class BackUserController {
    @Resource
    private BackUserService userService;

    @ApiOperation("执行用户登录")
    @RequestMapping(value="/doLogin",method = RequestMethod.POST)
    @ResponseBody
    public JSONResult doLogin(String userName,String password){
        return new JSONResult(GlobleConstant.CODE_SUCCESS,"登录用户",userService.getCurrentUser(userName,password));
    }
}
